<template>
	<el-container>
		<el-header>缴费记录</el-header>
		<div style="width: 100%">
			<el-table :data="tableData" style="width: 100%">
				<el-table-column prop="id" label="订单号" width="150">
				</el-table-column>
				<el-table-column prop="type" label="项目类型" width="275">
				</el-table-column>
				<el-table-column prop="name" label="项目名称" width="275">
				</el-table-column>
				<el-table-column prop="cost" label="缴费金额(￥)" width="275">
				</el-table-column>
				<el-table-column prop="paytime" label="缴费时间" width="275">
				</el-table-column>
			</el-table>
			<el-pagination background layout="prev, pager, next" :total="1000">
			</el-pagination>
		</div>
		<el-footer></el-footer>
	</el-container>
</template>

<script>
	import {
		showMsgTitle
	} from '@/utils/api'
	import {
		showMsgConfirm
	} from '@/utils/api'
	import {
		getRequest
	} from '@/utils/api'
	
	export default {
		data() {
			return {
				tableData: [{}],
				checkList: ['选中且禁用', '复选框 A']
			}
		},
		mounted: function() {
			let url = "/patient/cashrecordlist";
			let _this = this;
			getRequest(url).then(resp => {
				if (resp.status == 200) {
					//alert(resp.data);
					_this.tableData = resp.data;
				} else {
					_this.$message({
						type: 'error',
						message: '数据加载失败!'
					});
				}
			}, resp => {
				_this.loading = false;
				if (resp.response.status == 403) {
					_this.$message({
						type: 'error',
						message: resp.response.data
					});
				} else {
					_this.$message({
						type: 'error',
						message: '数据加载失败!'
					});
				}
			}).catch(resp => {
				//压根没见到服务器
				_this.loading = false;
				_this.$message({
					type: 'error',
					message: '数据加载失败!'
				});
			});
		},
		methods: {
			handleEdit(index, row) {
				console.log(index, row);
			},
			handleDelete(index, row) {
				console.log(index, row);
			}
		}
	}
</script>

<style>
	.el-header,
	.el-footer {
		background-color: #4fc1b0;
		color: #ffffff;
		text-align: left;
		line-height: 60px;
		font-size: 50px;
	}
</style> 
